package com.itr.kbm.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table (name = "LISTKOPEG")
@DynamicInsert
@DynamicUpdate
public class ListKopeg extends BaseObject{

	/**
	 * 
	 */
	private static final long serialVersionUID = 2L;
	private int id;
	private String kodeKopeg;
	private String namaKopeg;
	private String password;
	
	public ListKopeg(){}
	public ListKopeg(int id, String kodeKopeg, String namaKopeg, String password) {
		this.id = id;
		this.kodeKopeg = kodeKopeg;
		this.namaKopeg = namaKopeg;
		this.password = password;
	}
	@Id
	@Column(name = "ID")
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@Column(name = "KODEKOPEG")
	public String getKodeKopeg() {
		return kodeKopeg;
	}
	public void setKodeKopeg(String kodeKopeg) {
		this.kodeKopeg = kodeKopeg;
	}
		
	@Column(name = "NAMAKOPEG")
	public String getNamaKopeg() {
		return namaKopeg;
	}
	public void setNamaKopeg(String namaKopeg) {
		this.namaKopeg = namaKopeg;
	}
	
	@Column(name = "PASSWORD")
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		result = prime * result
				+ ((kodeKopeg == null) ? 0 : kodeKopeg.hashCode());
		result = prime * result
				+ ((namaKopeg == null) ? 0 : namaKopeg.hashCode());
		result = prime * result
				+ ((password == null) ? 0 : password.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ListKopeg other = (ListKopeg) obj;
		if (id != other.id)
			return false;
		if (kodeKopeg == null) {
			if (other.kodeKopeg != null)
				return false;
		} else if (!kodeKopeg.equals(other.kodeKopeg))
			return false;
		if (namaKopeg == null) {
			if (other.namaKopeg != null)
				return false;
		} else if (!namaKopeg.equals(other.namaKopeg))
			return false;
		if (password == null) {
			if (other.password != null)
				return false;
		} else if (!password.equals(other.password))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "ListKopeg [id=" + id + ", "
				+ (kodeKopeg != null ? "kodeKopeg=" + kodeKopeg + ", " : "")
				+ (namaKopeg != null ? "namaKopeg=" + namaKopeg + ", " : "")
				+ (password != null ? "password=" + password : "") + "]";
	}
	
	
}
